/**
 * Created by yuming619 on 2016/11/25.
 */
//服务
angular.module('mealplan.service.serviceitem', ['ngResource'])

//服务具体项目
    .service('ServiceItemService',  ['$resource', function ($resource) {

        this.insert = function (serviceitem, success, error) {
            var resource = $resource(cmturl + "serviceitem");
            return resource.save({}, serviceitem, success, error);
        };
        this.update = function (serviceitemid, serviceitem, success, error) {
            var resource = $resource(cmturl + "serviceitem/:serviceitemid");
            return resource.save({serviceitemid: serviceitemid}, serviceitem, success, error);
        };
        this.remove = function (serviceid) {
            var resource = $resource(cmturl + "serviceitem/serviceid/:serviceid")
            return resource.remove({serviceid: serviceid});
        }
        this.getbyserviceid = function (serviceid) {
            var resource = $resource(cmturl + "serviceitem/serviceid/:serviceid")
            return resource.query({serviceid: serviceid});
        }
        this.getbyid = function (serviceitemid) {
            var resource = $resource(cmturl + "serviceitem/:serviceitemid")
            return resource.get({serviceitemid: serviceitemid});
        }
    }])